<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<html>
<head>
    <title>自定义菜单列表</title>
</head>
<body>
<div class="pageheader">
    <h2>自定义菜单列表</h2>
</div>
<div class="contentpanel">

    <div class="btn-group mr10">
        <c:if test="${listDto.showAdd}">
            <a class="btn btn-primary" href="${contextPath}/admin/wechat/edit_button.htm">新增一级按钮</a>
        </c:if>
        <a class="btn btn-success" href="${contextPath}/admin/wechat/push_menu.htm">发布菜单</a>
    </div>

    <table class="table table-striped dataTable no-footer" id="table2" role="grid" aria-describedby="table2_info">
        <thead>
        <tr role="row">
            <th class="sorting_asc" tabindex="0" aria-controls="table2"
                rowspan="1" colspan="1" aria-sort="ascending">
                名称
            </th>
            <th class="sorting_asc" tabindex="0" aria-controls="table2"
                rowspan="1" colspan="1" aria-sort="ascending">
                类型
            </th>
            <th class="sorting_asc" tabindex="0" aria-controls="table2"
                rowspan="1" colspan="1" aria-sort="ascending">
                key值
            </th>
            <th class="sorting_asc" tabindex="0" aria-controls="table2"
                rowspan="1" colspan="1" aria-sort="ascending">
                跳转地址
            </th>
            <th class="sorting_asc" tabindex="0" aria-controls="table2"
                rowspan="1" colspan="1" aria-sort="ascending">
                创建时间
            </th>
            <th class="sorting" tabindex="0" aria-controls="table2" rowspan="1" colspan="1">
                操作
            </th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${listDto.buttonList}" var="item" varStatus="status">
            <tr class="gradeA ${status.index/2 eq 0?"odd":"even"}"><custom:button_list_item item="${item}"/></tr>
            <c:forEach items="${item.subButtonList}" var="subItem">
                <tr class="gradeA ${status.index/2 eq 0?"even":"odd"}"><custom:button_list_item item="${subItem}"/></tr>
            </c:forEach>
        </c:forEach>
        </tbody>
    </table>

</div>

<script type="text/javascript">
    <c:if test="${not empty param.push and param.push}">
    jQuery.gritter.add({
        title: '更新成功!',
        class_name: "growl-success",
        sticky: false
    });
    </c:if>
    <c:if test="${not empty param.push and not param.push}">
    jQuery.gritter.add({
        title: '更新失败!',
        class_name: "growl-danger",
        sticky: false
    });
    </c:if>
    <c:if test="${not empty param.delete}">
    jQuery.gritter.add({
        title: '删除成功!',
        class_name: "growl-success",
        sticky: false
    });
    </c:if>
    <c:if test="${not empty param.edit}">
    jQuery.gritter.add({
        title: '新增/编辑成功!',
        class_name: "growl-success",
        sticky: false
    });
    </c:if>
</script>
</body>
</html>
